//
//  LEOrderCell.m
//  LoveExpressBusiness
//
//  Created by 刘甲奇 on 2017/5/12.
//  Copyright © 2017年 DFH. All rights reserved.
//

#import "LEOrderCell.h"
#import "UIImageView+WebCache.h"

@interface LEOrderCell()
@property (weak, nonatomic) IBOutlet UILabel *orderNumberLabel;
@property (weak, nonatomic) IBOutlet UILabel *orderStatusLabel;
@property (weak, nonatomic) IBOutlet UIImageView *goodIV;
@property (weak, nonatomic) IBOutlet UIImageView *goodIV1;
@property (weak, nonatomic) IBOutlet UILabel *goodNameLabel;
@property (weak, nonatomic) IBOutlet UILabel *priceLabel;

@end

@implementation LEOrderCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setModel:(LEOderModel *)model
{
    self.orderNumberLabel.text = [NSString stringWithFormat:@"订单号: %@",model.order_sn];
    self.orderStatusLabel.text = model.state_desc;
    if (model.goods.count>1) {
        self.goodIV1.hidden = NO;
        self.goodNameLabel.hidden = YES;
        LEOrderGoodsModel *goodModel = model.goods[0];
        LEOrderGoodsModel *goodModel1 = model.goods[1];
        [self.goodIV sd_setImageWithURL:[NSURL URLWithString:goodModel.goods_image_url]];
        [self.goodIV1 sd_setImageWithURL:[NSURL URLWithString:goodModel1.goods_image_url]];

    }else{
        self.goodIV1.hidden = YES;
        self.goodNameLabel.hidden = NO;
        LEOrderGoodsModel *goodModel = model.goods[0];
        [self.goodIV sd_setImageWithURL:[NSURL URLWithString:goodModel.goods_image_url]];
        self.goodNameLabel.text = goodModel.goods_name;
    }
    self.priceLabel.text = [NSString stringWithFormat:@"价格:¥%@",model.order_amount];
}

@end
